<?php

/**
 * Taxes form base class.
 *
 * @package    tvpv
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 12815 2008-11-09 10:43:58Z fabien $
 */
class BaseTaxesForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'           => new sfWidgetFormInputHidden(),
      'name'         => new sfWidgetFormInput(),
      'category'     => new sfWidgetFormPropelChoice(array('model' => 'Taxcategories', 'add_empty' => false)),
      'custcategory' => new sfWidgetFormPropelChoice(array('model' => 'Taxcustcategories', 'add_empty' => true)),
      'parentid'     => new sfWidgetFormPropelChoice(array('model' => 'Taxes', 'add_empty' => true)),
      'rate'         => new sfWidgetFormInput(),
      'ratecascade'  => new sfWidgetFormInput(),
      'rateorder'    => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id'           => new sfValidatorPropelChoice(array('model' => 'Taxes', 'column' => 'id', 'required' => false)),
      'name'         => new sfValidatorString(array('max_length' => 255)),
      'category'     => new sfValidatorPropelChoice(array('model' => 'Taxcategories', 'column' => 'id')),
      'custcategory' => new sfValidatorPropelChoice(array('model' => 'Taxcustcategories', 'column' => 'id', 'required' => false)),
      'parentid'     => new sfValidatorPropelChoice(array('model' => 'Taxes', 'column' => 'id', 'required' => false)),
      'rate'         => new sfValidatorNumber(),
      'ratecascade'  => new sfValidatorString(array('max_length' => 1)),
      'rateorder'    => new sfValidatorInteger(array('required' => false)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'Taxes', 'column' => array('name')))
    );

    $this->widgetSchema->setNameFormat('taxes[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Taxes';
  }


}
